﻿using agsXMPP.protocol.client;
using agsXMPP.protocol.iq.roster;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Windows.Media;

namespace Mammoth.Entities
{
    public class UserEntity : Entity, IGtalkEntity
    {
        public UserEntity():base()
        {
            PresenceType = PresenceType.invisible;
            SubscriptionType = SubscriptionType.both;
        }

        [Required(ErrorMessage="Email tidak boleh kosong")]
        [StringLength(256, ErrorMessage="Email tidak boleh lebih dari 256 karakter")]
        public virtual string Email { get; set; }
        [Required(ErrorMessage="Nama tidak boleh kosong")]
        [StringLength(256, ErrorMessage = "Nama tidak boleh lebih dari 256 karakter")]
        public virtual string Name { get; set; }
        [Required(ErrorMessage = "Password tidak boleh kosong")]
        [StringLength(64, ErrorMessage = "Password tidak boleh lebih dari 64 karakter")]
        public string Password { get; set; }

        [NotMapped]
        public virtual string Status { get; set; }
        [NotMapped]
        public virtual SubscriptionType SubscriptionType { get; set; }
        [NotMapped]
        public virtual PresenceType PresenceType { get; set; }
        [NotMapped]
        public virtual ImageSource Avatar { get; set; }

        [Required(ErrorMessage="Akun tidak boleh kosong")]
        public AccountEntity Account { get; set; }
        public virtual IList<InboxEntity> Inbox { get; set; }
        public virtual IList<OutboxEntity> Outbox { get; set; }
    }
}
